//
//  AppTools.m
//  礼物说
//
//  Created by dllo on 16/5/13.
//  Copyright © 2016年 sunzhichao. All rights reserved.
//

#import "AppTools.h"

@implementation AppTools

+ (void)createAlert:(NSString *)str viewController:(UIViewController *)veiwController str1:(NSString *)str1 back:(BOOL)back {
    
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:str message:str1 preferredStyle: UIAlertControllerStyleAlert];
    
    [veiwController presentViewController:alert animated:YES completion:nil];
    
    [UIView animateWithDuration:10 animations:^{
        
        [veiwController dismissViewControllerAnimated:YES completion:^{
            
            if (back) {
                
                [veiwController.navigationController popToRootViewControllerAnimated:YES];
            }
        }];
    }];
}

@end
